package Test;

import domain.QunYuan;
import domain.QunZhu;

import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;

public class Demo02 {
    public static void main(String[] args) {
    }
    public static ArrayList<Integer> faMoney(ArrayList<Integer> list,int fenShu,int money,int zongMoney){
        for (int i = 1; i <= fenShu; i++) {
            int moneny1 =money/fenShu;
           if(i!=fenShu)
               list.add(moneny1);
            else if(i==fenShu){
                list.add(money-moneny1*fenShu+moneny1);
            }
        }
        System.out.println("你还有"+(zongMoney-money));
        return  list;
    }
    public static void shouMoney( ArrayList<Integer> list,int fenShu){
        int zongMoeny =0;
        Random ra = new Random();
        int i = ra.nextInt(fenShu) + 1;
       zongMoeny+=list.get(i);
        System.out.println("您抢到了"+list.get(i));
        System.out.println("你还有多少钱"+zongMoeny);
    }
}
